﻿using UnityEngine;
using System.Collections;


namespace HDJ.Framework.Core.FixedPointy
{
    public static class UnityExtends
    {
        public static Vector3 ToVector3(this FixVector3 fv3)
        {
            double x = (double)fv3.x;
            double y = (double)fv3.y;
            double z = (double)fv3.z;
            return new Vector3((float)x, (float)y, (float)z);
        }

        public static Vector2 ToVector2(this FixVector2 fv2)
        {
            double x = (double)fv2.x;
            double y = (double)fv2.y;
            return new Vector2((float)x, (float)y);
        }

        public static FixVector3 ToFixVector3(this Vector3 fv3)
        {
            return new FixVector3(fv3.x, fv3.y, fv3.z);
        }

        public static FixVector2 ToFixVector2(this Vector2 fv2)
        {
            return new FixVector2(fv2.x, fv2.y);
        }

    }
}
